﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataTier;

namespace BusinessTier
{
    public class PathFinderCtr
    {

        private static PathFinderCtr _instance = null;
        private LocationCtr _locationCtr = LocationCtr.Instance;

        private PathFinderCtr()
        {
        }

        public static PathFinderCtr Instance
        {
            get
            {

                if (_instance == null)
                {
                    _instance = new PathFinderCtr();
                }

                return _instance;

            }
        }

        public Route FindPath(Location from, Location to)
        {
            PathFinder pathFinder = new PathFinder(_locationCtr.GetAllLocations());
            return pathFinder.FindPath(from, to);
        }

    }
}
